/*
* 模块描述：栅格系统
* 模块兼容：Chrome（latest-1）、Firefox（latest-1）、Explorer（9+）
* 模块作者：@iyoole
* 更新时间：2017-01-23
* 其他说明：栅格暂停止使用
*/

// 居中容器元素
.container-fixed(@gutter: @grid-gutter-width) {
    margin-left: auto;
    margin-right: auto;
    padding-left: (@gutter / 2);
    padding-right: (@gutter / 2);

    &:extend(.clearfix all);
}

// 为一系列列创建一个包装容器
.make-row(@gutter: @grid-gutter-width) {
    margin-left: ceil((@gutter / -2));
    margin-right: floor((@gutter / -2));

    &:extend(.clearfix all);
}

// 生成 extra small 列
.make-xs-column(@columns; @gutter: @grid-gutter-width) {
    position: relative;
    float: left;
    width: percentage((@columns / @grid-columns)); // 百分比
    min-height: 1px;
    padding-left: (@gutter / 2);
    padding-right: (@gutter / 2);
}

.make-xs-column-offset(@columns) {
    margin-left: percentage((@columns / @grid-columns));
}

.make-xs-column-push(@columns) {
    left: percentage((@columns / @grid-columns));
}

.make-xs-column-pull(@columns) {
    right: percentage((@columns / @grid-columns));
}

// 生成 small 列
.make-sm-column(@columns; @gutter: @grid-gutter-width) {
    position: relative;
    min-height: 1px;
    padding-left: (@gutter / 2);
    padding-right: (@gutter / 2);

    @media (min-width: @screen-sm-min) {
        float: left;
        width: percentage((@columns / @grid-columns));
    }
}

.make-sm-column-offset(@columns) {
    @media (min-width: @screen-sm-min) {
        margin-left: percentage((@columns / @grid-columns));
    }
}

.make-sm-column-push(@columns) {
    @media (min-width: @screen-sm-min) {
        left: percentage((@columns / @grid-columns));
    }
}

.make-sm-column-pull(@columns) {
    @media (min-width: @screen-sm-min) {
        right: percentage((@columns / @grid-columns));
    }
}

// 生成 medium 列
.make-md-column(@columns; @gutter: @grid-gutter-width) {
    position: relative;
    min-height: 1px;
    padding-left: (@gutter / 2);
    padding-right: (@gutter / 2);

    @media (min-width: @screen-md-min) {
        float: left;
        width: percentage((@columns / @grid-columns));
    }
}

.make-md-column-offset(@columns) {
    @media (min-width: @screen-md-min) {
        margin-left: percentage((@columns / @grid-columns));
    }
}

.make-md-column-push(@columns) {
    @media (min-width: @screen-md-min) {
        left: percentage((@columns / @grid-columns));
    }
}

.make-md-column-pull(@columns) {
    @media (min-width: @screen-md-min) {
        right: percentage((@columns / @grid-columns));
    }
}

// 生成 large 列
.make-lg-column(@columns; @gutter: @grid-gutter-width) {
    position: relative;
    min-height: 1px;
    padding-left: (@gutter / 2);
    padding-right: (@gutter / 2);

    @media (min-width: @screen-lg-min) {
        float: left;
        width: percentage((@columns / @grid-columns));
    }
}

.make-lg-column-offset(@columns) {
    @media (min-width: @screen-lg-min) {
        margin-left: percentage((@columns / @grid-columns));
    }
}

.make-lg-column-push(@columns) {
    @media (min-width: @screen-lg-min) {
        left: percentage((@columns / @grid-columns));
    }
}

.make-lg-column-pull(@columns) {
    @media (min-width: @screen-lg-min) {
        right: percentage((@columns / @grid-columns));
    }
}
